<template>
    <view class="page">
        <view class="message-list">
            <view class="list" @click="onMessage('activity')">
                <view class="icon-data">
                    <view class="icon">
                        <!-- <image src="/static/hd-mess.png" mode=""></image> -->
                    </view>
                    <view class="data">
                        <view class="title">
                            <text>优惠活动</text>
                        </view>
                        <view class="describe">
                            <text>双十一5折起</text>
                        </view>
                    </view>
                </view>
                <view class="more">
                    <text class="iconfont icon-more"></text>
                </view>
            </view>
            <view class="list" @click="onMessage('inform')">
                <view class="icon-data">
                    <view class="icon" style="background-color: rgba(255, 125, 88, 1);">
                        <!-- <image src="/static/tz-mess.png" mode=""></image> -->
                    </view>
                    <view class="data">
                        <view class="title">
                            <text>通知消息</text>
                        </view>
                        <view class="describe">
                            <text>您的订单已发货</text>
                        </view>
                    </view>
                </view>
                <view class="more">
                    <text class="iconfont icon-more"></text>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {

        };
    },
    methods: {
        /**
         * 消息点击
         * @param {String} type
         */
        onMessage(type) {
            switch (type) {
                case 'activity':
                    uni.navigateTo({
                        url: '/pagesA/message/discountsActivity',
                    })
                    break;
                case 'inform':
                    uni.navigateTo({
                        url: '/pagesA/message/notificationMessage',
                    })
                    break;
            }
        }
    }
}
</script>

<style scoped lang="scss">
.page {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: #f6f6f6;
}

.message-list {
  padding: 0 4%;
  background-color: #ffffff;
  border-radius: 0 0 20rpx 20rpx;
  .list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 140rpx;
    border-bottom: 2rpx solid #f6f6f6;
    .icon-data {
      display: flex;
      align-items: center;
      width: 80%;
      height: 100%;
      .icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100rpx;
        height: 100rpx;
        border-radius: 20rpx;
        background-color: rgba(245, 145, 32, 1);
        image {
          width: 60rpx;
          height: 60rpx;
        }
      }
      .data {
        margin-left: 20rpx;
        .title {
          display: flex;
          width: 100%;
          text {
            font-size: 28rpx;
            color: #222222;
          }
        }
        .describe {
          width: 100%;
          margin-top: 10rpx;
          text {
            font-size: 24rpx;
            color: #959595;
          }
        }
      }
    }
    .more {
      display: flex;
      align-items: center;
      text {
        font-size: 28rpx;
        color: #959595;
      }
    }
  }
}
</style>
